namespace UnorderedSet
{
	template<class K, class Hash = HashFun<K>>
	class unordered_set
	{
		struct KeySet
		{
			const K& operator()(const K& key)
			{
				return key;
			}
		};
	public:
		typedef typename HashBucket::_HashTable<K, K, Hash, KeySet>::iterator iterator;
		iterator begin() { return _hash.begin(); }
		iterator end() { return _hash.end(); }

		pair<iterator, bool> insert(const K& k) { return _hash.insert(k); }
		iterator find(const K& k) { return _hash.find(k); }
		bool erase(const K& k) { return _hash.erase(k); }

	private:
		HashBucket::_HashTable<K, K, Hash, KeySet> _hash;
	};

	void test_set()
	{
		unordered_set<int> s;
		s.insert(2);
		s.insert(3);
		s.insert(1);
		s.insert(2);
		s.insert(5);

		unordered_set<int>::iterator it = s.begin();
		//auto it = s.begin();
		while (it != s.end())
		{
			cout << *it << " ";
			++it;
		}
		cout << endl;
	}
}
